//
//  SAClassifyDetailCell.m
//  YunFu
//
//  Created by Bager on 2018/9/12.
//  Copyright © 2018年 yunfu. All rights reserved.
//

#import "SAClassifyDetailCell.h"

@implementation SAClassifyDetailCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self)
    {
        [self setViews];
        self.backgroundColor = [UIColor whiteColor];
    }
    return self;
}

- (void)setViews
{
    [self addSubview:self.img];
    [self addSubview:self.name];
}

- (UIImageView *)img
{
    if (!_img)
    {
        _img = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, (kScreenWidth - 10 - 30 - 80) / 3.0, 80)];
        _img.contentMode = UIViewContentModeScaleAspectFit;
        _img.layer.masksToBounds = YES;
        [_img setImage:[UIImage imageNamed:@"yf3_pic6"]];
    }
    return _img;
}

- (UILabel *)name
{
    if (!_name)
    {
        _name = [[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(self.img.frame), CGRectGetWidth(self.img.frame), 20)];
        _name.font = [UIFont systemFontOfSize:14];
        _name.adjustsFontSizeToFitWidth = YES;
        _name.textAlignment = NSTextAlignmentCenter;
        _name.text = @"牛仔裤";
    }
    return _name;
}

@end
